#include<ctime>
#include<cstdio>
#include<cstdlib>
#include<unistd.h>
#include"graph.h"
#define rep(i,a,b) for(int i(a);i<=(b);++i)
int nnn,xxx,yyy,rrr,ans[201];
#ifdef __UNIX__
class IOLocker
{
	public:
		const int MAX_MOGIC_DUP=100;
		IOLocker():in(STDIN_FILENO),out(STDOUT_FILENO)
		{
			srand(time(0));
			lock();
		}
		void lock()
		{
			int cnt=rand()%MAX_MOGIC_DUP;
			rep(i,0,cnt-1) dup(STDERR_FILENO);
			int nin=dup(in);
			fclose(stdin);
			close(in);
			in=nin;
			int nout=dup(out);
			fclose(stdout);
			close(out);
			out=nout;
			stdin=stdout=NULL;
		}
		void unlock()
		{
			stdin=fdopen(in,"r");
			stdout=fdopen(out,"w");
		}
	private:
		int in,out;
};
#endif
void Inspect(int R)
{
#ifdef __UNIX__
	static IOLocker io __attribute__((init_priority(101)));
	io.unlock();
#endif
	fseek(stdin,0,0);
	scanf("%d%d%d",&nnn,&xxx,&rrr);
	rep(i,1,nnn)
	{
		scanf("%d",&xxx);
		rep(j,1,xxx) scanf("%d",&yyy);
	}
	rep(i,1,rrr) scanf("%d",ans+i);
	fseek(stdin,0,0);
	rep(i,1,R) Answer(i,ans[i]);
}
